package com.cskaoyan.service.vx;

import com.cskaoyan.bean.po.wxPo.MarketIssue;
import com.cskaoyan.bean.vo.TVO;
import com.cskaoyan.mapper.wxMapper.MarketIssueMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: DYQ
 * @time: Created on 2022/6/10 9:46
 */

@Service
public class MarketIssueServiceImpl implements MarketIssueService {

    @Autowired
    MarketIssueMapper marketIssueMapper;

    @Override
    public TVO queryIssueList(Integer limit, Integer page) {
        PageHelper.startPage(page, limit);
        List<MarketIssue> marketIssues = marketIssueMapper.queryIssueList();
        PageInfo pageInfo = new PageInfo(marketIssues);
        return TVO.data(pageInfo.getTotal(), pageInfo.getPages(), limit, page, marketIssues);
    }
}
